#ifndef VIEWWIDGET_H
#define VIEWWIDGET_H

#include <QWidget>
#include <QLabel>
#include <QComboBox>
#include <QPushButton>
#include <pageandview/pagewidget.h>
#include <pageandview/common.h>

class PageWidget;

class ViewWidget : public QWidget
{
    Q_OBJECT
public:
    explicit ViewWidget(QWidget *parent = 0, PageWidget *page = 0, IPluginGadget * pluginconfig = 0);
    virtual ~ViewWidget();
    void setFocusPlugin();
    void clearFocusPlugin();
    bool isFocus();
    int indexOfClassId(QString classId);
    void removePlugin();
    void switch_plugin(int index);
    IPluginGadget* getPluginGadget() {return m_plugingadget;}
    QString classId() const { return m_plugingadget->classId(); }

signals:

private slots:
    void doReplaceGadget(int index);
    void currentPluginChanged(IPluginGadget *plugin);
    void closeView();

private:
    PluginManager *pm;
    PageWidget * m_pagewidget;
    IPluginGadget* m_plugingadget;

    //UI
    QVBoxLayout * m_layout;
    QHBoxLayout * m_toolbarLayout;
    QComboBox *m_uavGadgetList;
    QPushButton *m_closeButton;
    bool isActive;
};

#endif // VIEWWIDGET_H
